const TOKEN_KEY = "token";
const TOKEN_REFRESH_KEY = "refresh_token";

const getToken = () => {
  return uni.getStorageSync(TOKEN_KEY);
};
const getRefreshToken = () => {
  return uni.getStorageSync(TOKEN_REFRESH_KEY);
};
const setToken = (access_token, refresh_token) => {
  uni.setStorageSync(TOKEN_KEY, access_token);
  uni.setStorageSync(TOKEN_REFRESH_KEY, refresh_token);
};
const removeToken = () => {
  uni.removeStorageSync(TOKEN_KEY);
  uni.removeStorageSync(TOKEN_REFRESH_KEY);
};
const token = { getToken, getRefreshToken, setToken, removeToken };

export default token;
